package com.lge.qcontact.utils;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;


public class LocalDBHelper extends SQLiteOpenHelper {
	private static final String DB_NAME = "QContactsDB";
	private static final int DB_VERSION = 1;
	
	public LocalDBHelper(Context context) {
		super(context, DB_NAME, null, DB_VERSION);
		
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		
		db.execSQL("create table if not exists CONTACTS " +
				   "(gName text, " +
				   " uId text," +
				   " uName text, " +
				   " phoneNo text," +
				   " mobile text," +
				   " email text," +
				   " isMaster text," +
				   " photoId integer);");
		
		db.execSQL("create table if not exists LOGIN_INFO " +
				   "(uId text, " +
				   " uPw text," +
				   " isAutoLogin text);");
		
		
	
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int arg1, int arg2) {;
		db.execSQL("drop table if exists CONTACTS");
		db.execSQL("drop table if exists LOGIN_INFO");
		
		onCreate(db);
	}

}
